Index

api/v1/pos/{pono}/stock

Path: api/v1/pos/{pono}/stock

This API is JSON:API compliant.

This endpoint supports the following methods:
GET POST PATCH DELETE

The resource type for this endpoint is PurchaseStock
The identifier is pono-lineid

The PurchaseStock resource type attributes are as follows:

{
The quantity ordered. Updating the quantity ordered has no impact on quantity received.
"qty":number
The quantity to be received. Updating the quantity received has no impact on quantity ordered.
"qtyReceived":number
The unit price. If PO is calculating prices from tax paid amounts this will be tax inclusive, otherwise this will be tax exclusive.
It is highly recommended to set only one of unitPrice, unitPriceTF, or unitPriceTP - if multiple are set the last one processed wins.

"unitPrice":number
The unit price exlusive of tax. Note that if PO is calculating prices from tax paid amounts the actual price set may differ due to rounding.
It is highly recommended to set only one of unitPrice, unitPriceTF, or unitPriceTP - if multiple are set the last one processed wins.

"unitPriceTF":number
The unit price inclusive of tax. Note that if PO is calculating prices from tax exclusive amounts the actual price set may differ due to rounding.
It is highly recommended to set only one of unitPrice, unitPriceTF, or unitPriceTP - if multiple are set the last one processed wins.

"unitPriceTP":number
Stock attribute configuration number.
optional
"configNo":integer (read-only) Note: Will not be returned in the response if value is null.
"serials": [{
A stock serial number.
"serialNo":string
Only applicable to stock that is serial and attributed on purchase or serial on sell.
optional
"stockAttrs": [{
The attribute name.
"name":string
The attribute value. Note, this is always send as a string, but the attribute type dictates the acceptable string formats.
eg integer attributes values must be a whole number
date attribute values must be a date is ISO format
real attribute values must be a decimal string (with period as the decimal separator)checkbox values must be a boolan value ("true", or "false").

"value":string
}]
}]
"stockAttrs": [{
The attribute name.
"name":string
The attribute value. Note, this is always send as a string, but the attribute type dictates the acceptable string formats.
eg integer attributes values must be a whole number
date attribute values must be a date is ISO format
real attribute values must be a decimal string (with period as the decimal separator)checkbox values must be a boolan value ("true", or "false").

"value":string
}]
"addinit":string (read-only)
optional
"adddate":string (DateTime in ISO format) (read-only)
"stockId":integer (read-only)
The Jim2 stock code
"stockCode":string (read-only)
"unit":string (read-only)
The stock description. Only required if the default stock description needs to be overrridden. It is recommended this be set for special stock.
optional
"description":string
"modifyinit":string (read-only)
"modifydate":string (DateTime in ISO format) (read-only)
}

Example GET (Return all)

Path: api/v1/pos/10/stock

Response:

{
  "data": [
    {
      "id": "10-1",
      "type": "PurchaseStock",
      "attributes": {
        "qty": 2.0,
        "qtyReceived": 2.0,
        "unitPrice": 20.0,
        "unitPriceTF": 20.0,
        "unitPriceTP": 20.0,
        "serials": [
          {
            "serialNo": "serial1"
          },
          {
            "serialNo": "serial2"
          }
        ],
        "addinit": "API",
        "adddate": "2025-03-27T12:39:00",
        "stockId": 3,
        "stockCode": "SAMSUNG.MON.CONNECT",
        "unit": "EACH",
        "description": "Samsung Monitor Connector.",
        "modifyinit": "API",
        "modifydate": "2025-03-27T12:39:00"
      }
    },
    {
      "id": "10-2",
      "type": "PurchaseStock",
      "attributes": {
        "qty": 1.0,
        "qtyReceived": 0.0,
        "unitPrice": 0.0,
        "unitPriceTF": 0.0,
        "unitPriceTP": 0.0,
        "stockAttrs": [
          {
            "name": "Colour",
            "value": "R,Red"
          },
          {
            "name": "Size",
            "value": "8,Eight"
          }
        ],
        "addinit": "SYS",
        "adddate": "2025-03-27T13:07:00",
        "stockId": 5,
        "stockCode": "MOUSE",
        "unit": "EACH",
        "description": "Mouse",
        "modifyinit": "SYS",
        "modifydate": "2025-03-27T13:07:00"
      }
    },
    {
      "id": "10-3",
      "type": "PurchaseStock",
      "attributes": {
        "qty": 1.0,
        "qtyReceived": 0.0,
        "unitPrice": 0.0,
        "unitPriceTF": 0.0,
        "unitPriceTP": 0.0,
        "serials": [
          {
            "serialNo": "serial11",
            "stockAttrs": [
              {
                "name": "Colour",
                "value": "R,Red"
              },
              {
                "name": "Size",
                "value": "8,Eight"
              }
            ]
          }
        ],
        "addinit": "SYS",
        "adddate": "2025-03-27T13:07:00",
        "stockId": 7,
        "stockCode": "MOUSE2",
        "unit": "EACH",
        "description": "Mouse2",
        "modifyinit": "SYS",
        "modifydate": "2025-03-27T13:07:00"
      }
    }
  ]
}

Example GET (Return specific)

Path: api/v1/pos/10/stock/10-1

Response:

{
  "data": {
    "id": "10-1",
    "type": "PurchaseStock",
    "attributes": {
      "qty": 2.0,
      "qtyReceived": 2.0,
      "unitPrice": 20.0,
      "unitPriceTF": 20.0,
      "unitPriceTP": 20.0,
      "serials": [
        {
          "serialNo": "serial1"
        },
        {
          "serialNo": "serial2"
        }
      ],
      "addinit": "API",
      "adddate": "2025-03-27T12:39:00",
      "stockId": 3,
      "stockCode": "SAMSUNG.MON.CONNECT",
      "unit": "EACH",
      "description": "Samsung Monitor Connector.",
      "modifyinit": "API",
      "modifydate": "2025-03-27T12:39:00"
    },
    "links": {
      "self": "/api/v1/pos/10/stock/10-1"
    }
  }
}

Example POST

Path: api/v1/pos/10/stock

Request:

{
    "data": {
        "type": "PurchaseStock",
      "attributes": {
        "qty": 3.0,
        "qtyReceived": 1.0,
        "unitPriceTF": 10.0,
        "stockCode": "SAMSUNG.MON.CONNECT",
        "description": "Samsung Monitor Connector. New",
        "serials": [
          {
            "serialNo": "serial1"
          },
          {
            "serialNo": "serial2"
          },
          {
            "serialNo": "serial3"
          }
        ]
      }
    }
}

Response:

{
    "data": {
        "id": "10-5",
        "type": "PurchaseStock",
      "attributes": {
        "qty": 3.0,
        "qtyReceived": 1.0,
        "unitPrice": 10.0,
        "unitPriceTF": 10.0,
        "unitPriceTP": 10.0,
        "serials": [
          {
            "serialNo": "serial1"
          },
          {
            "serialNo": "serial2"
          },
          {
            "serialNo": "serial3"
          }
        ],
        "addinit": "API",
        "adddate": "2025-03-27T13:15:09.3523149+11:00",
        "stockId": 3,
        "stockCode": "SAMSUNG.MON.CONNECT",
        "unit": "EACH",
        "description": "Samsung Monitor Connector. New",
        "modifyinit": "API",
        "modifydate": "2025-03-27T13:15:09.3523149+11:00"
      },
      "links": {
        "self": "/api/v1/pos/10/stock/10-5"
      }
    }
}

Example PATCH

Path: api/v1/pos/10/stock/10-1

Request:

{
    "data": {
        "id": "10-1",
        "type": "PurchaseStock",
        "attributes": {
            "qty": 5.0,
            "qtyReceived": 3.0,
            "unitPriceTF": 30.0,
            "description": "Samsung Monitor Connector. Extra"
        }
    }
}

Response:

{
    "data": {
        "id": "10-1",
        "type": "PurchaseStock",
        "attributes": {
            "qty": 5.0,
            "qtyReceived": 3.0,
            "unitPrice": 30.0,
            "unitPriceTF": 30.0,
            "unitPriceTP": 30.0,
            "addinit": "API",
            "adddate": "2025-03-27T12:39:00",
            "stockId": 3,
            "stockCode": "SAMSUNG.MON.CONNECT",
            "unit": "EACH",
            "description": "Samsung Monitor Connector. Extra",
            "modifyinit": "API",
            "modifydate": "2025-03-27T12:39:00"
        },
      "links": {
        "self": "/api/v1/pos/10/stock/10-1"
      }
    }
}